//
//  CZMessionCenterCollectionViewCell.m
//  nsj_iOS
//
//  Created by apple on 2016/12/8.
//  Copyright © 2016年 GCZ. All rights reserved.
//

#import "CZMessionCenterCollectionViewCell.h"
#import "CZMessionCenterCartoonAlbumView.h"

@interface CZMessionCenterCollectionViewCell ()

@end
@implementation CZMessionCenterCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        CZMessionCenterCartoonAlbumView *albumView = [[[NSBundle mainBundle] loadNibNamed:@"CZMessionCenterCartoonAlbumView" owner:nil options:nil] firstObject];
        [self.contentView addSubview:albumView];
        [albumView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView);
        }];
        _albumView = albumView;
        
//        [self layoutIfNeeded];
//        albumView.userIcon.layer.cornerRadius = albumView.userIcon.frame.size.width / 2;
//        albumView.userIcon.layer.borderWidth = 1.f;
//        albumView.userIcon.layer.borderColor = [UIColor whiteColor].CGColor;
//        albumView.userIcon.clipsToBounds = YES;
        
        // 阴影视图
//        UIView *shadowView = [[UIView alloc] initWithFrame:albumView.userIcon.bounds];
//        shadowView.layer.cornerRadius = albumView.userIcon.frame.size.width / 2;
//        shadowView.layer.shadowRadius = shadowView.layer.cornerRadius;
//        shadowView.layer.shadowOpacity = 1;
//        shadowView.layer.shadowOffset = CGSizeMake(0, -5);
//        shadowView.layer.contentsScale = [UIScreen mainScreen].scale;
//        shadowView.backgroundColor = [UIColor redColor];
//        [albumView.userIcon addSubview:shadowView];
        
//        CALayer *shadowLayer = [CALayer layer];
//        shadowLayer.frame = albumView.userIcon.bounds;
//        shadowLayer.cornerRadius = albumView.userIcon.layer.cornerRadius;
//        shadowLayer.shadowColor = [UIColor blackColor].CGColor;
//        shadowLayer.shadowOffset = CGSizeMake(0, -10);
//        shadowLayer.shadowOpacity = 1;
//        shadowLayer.shadowRadius = 3;
//        shadowLayer.masksToBounds = NO;
//        
////        [albumView.userIcon.layer addSublayer:shadowLayer];
//        [self.layer insertSublayer:shadowLayer below:albumView.layer];

    }
    return self;
}

@end
